﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
namespace AnyOffice.module.priv_select
{
    public partial class index : BasePage
    {
        private int count;
        public string strPrivList;
        public index()
        {

            this.strPrivList = "";
        } 

        protected void Page_Load(object sender, EventArgs e)
        {
            this.ViewState["ToId"] = (Request.QueryString["ToId"] != null) ? Request.QueryString["ToId"].ToString() : "ToId";
            this.ViewState["ToName"] = (Request.QueryString["ToName"] != null) ? Request.QueryString["ToName"].ToString() : "ToName";
            StringBuilder builder = new StringBuilder();
            DataTable table = new UserPrivDao().SelectAll(base.Conn);
            if (table.Rows.Count > 0)
            {
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    string strPrivList = this.strPrivList;
                    this.strPrivList = strPrivList + "privlist[" + this.count.ToString() + "]=\"" + table.Rows[i]["PrivId"].ToString() + "\";\n";
                    this.count++;
                    builder.Append("<tr class=\"TableControl\">\n");
                    builder.Append("<td class=\"menulines\" id=\"PRIV_" + table.Rows[i]["PrivId"].ToString() + "\" name=\"" + table.Rows[i]["PrivName"].ToString() + "\" onclick=\"javascript:click_priv('" + table.Rows[i]["PrivId"].ToString() + "')\" align=center>" + table.Rows[i]["PrivName"].ToString() + "</td>\n");
                    builder.Append("</tr>\n");
                }
            }
            this.litPriv.Text = builder.ToString();
        }

 

 

    }
}
